package com.gouqi.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gouqi.common.DeleteRequest;
import com.gouqi.model.dto.scoringResult.ScoringResultAddRequest;
import com.gouqi.model.dto.scoringResult.ScoringResultEditRequest;
import com.gouqi.model.dto.scoringResult.ScoringResultQueryRequest;
import com.gouqi.model.dto.scoringResult.ScoringResultUpdateRequest;
import com.gouqi.model.entity.ScoringResult;
import com.gouqi.model.vo.ScoringResultVO;

import javax.servlet.http.HttpServletRequest;


public interface ScoringResultService extends IService<ScoringResult> {
    /**
     * 校验数据
     *
     * @param scoringResult
     * @param add           对创建的数据进行校验
     */
    void validScoringResult(ScoringResult scoringResult, boolean add);

    /**
     * 获取查询条件
     *
     * @param scoringResultQueryRequest
     * @return
     */
    LambdaQueryWrapper<ScoringResult> getQueryWrapper(ScoringResultQueryRequest scoringResultQueryRequest);

    /**
     * 获取评分结果封装
     *
     * @param scoringResult
     * @param request
     * @return
     */
    ScoringResultVO getScoringResultVO(ScoringResult scoringResult, HttpServletRequest request);

    /**
     * 分页获取评分结果封装
     *
     * @param scoringResultPage
     * @param request
     * @return
     */
    Page<ScoringResultVO> getScoringResultVOPage(Page<ScoringResult> scoringResultPage, HttpServletRequest request);

    /**
     * 添加评分结果
     *
     * @param scoringResultAddRequest
     * @param request
     * @return
     */
    long addScoringResult(ScoringResultAddRequest scoringResultAddRequest, HttpServletRequest request);

    /**
     * 删除评分结果
     *
     * @param deleteRequest
     * @param request
     */
    void deleteScoringResult(DeleteRequest deleteRequest, HttpServletRequest request);

    /**
     * 更新评分结果（仅管理员可用）
     *
     * @param scoringResultUpdateRequest
     */
    void updateScoringResult(ScoringResultUpdateRequest scoringResultUpdateRequest);

    /**
     * 根据 id 获取评分结果（封装类）
     *
     * @param id
     * @param request
     * @return
     */
    ScoringResultVO getScoringResult(long id, HttpServletRequest request);

    /**
     * 分页获取评分结果列表（仅管理员可用）
     *
     * @param scoringResultQueryRequest
     * @return
     */
    Page<ScoringResult> getScoringResultListPage(ScoringResultQueryRequest scoringResultQueryRequest);

    /**
     * 分页获取当前登录用户创建的评分结果列表
     *
     * @param scoringResultQueryRequest
     * @param request
     * @return
     */
    Page<ScoringResultVO> getMyScoringResultVOPage(ScoringResultQueryRequest scoringResultQueryRequest, HttpServletRequest request);

    /**
     * 编辑评分结果（给用户使用）
     *
     * @param scoringResultEditRequest
     * @param request
     */
    void editScoringResult(ScoringResultEditRequest scoringResultEditRequest, HttpServletRequest request);
}
